//
//  YYEAcountContentCell.m
//  YuYingEDU
//
//  Created by 胡波 on 2018/1/9.
//  Copyright © 2018年 胡波. All rights reserved.
//

#import "YYEAcountContentCell.h"

@implementation YYEAcountContentCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.nameLabel = [[UILabel alloc]init];
        self.nameLabel.textColor = [UIColor blackColor];
        self.nameLabel.font = [UIFont systemFontOfSize:15];
        [self.contentView addSubview:self.nameLabel];
        
        self.rightLabel = [[UILabel alloc]init];
        self.rightLabel.textColor = LineColor;
        self.rightLabel.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:self.rightLabel];
        
        self.rightTF = [[UITextField alloc]init];
        self.rightTF.textAlignment = NSTextAlignmentRight;
        [self.rightTF setValue:[UIFont systemFontOfSize:13] forKeyPath:@"_placeholderLabel.font"];
        self.rightTF.font = [UIFont systemFontOfSize:13];
        [self.contentView addSubview:self.rightTF];
        
        self.lineView = [[UIView alloc]init];
        self.lineView.backgroundColor = GeneralBackColor;
        [self.contentView addSubview:self.lineView];
        
    }
    return self;
    
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    [self.nameLabel makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(20);
        make.centerY.equalTo(self.contentView.centerY);
    }];
    
    [self.rightLabel makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(self.contentView.right).offset(-15);
        make.centerY.equalTo(self.contentView.centerY);
    }];
    
    [self.rightTF makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(80);
        make.right.equalTo(self.contentView.right).offset(-15);
        make.centerY.equalTo(self.contentView.centerY);
        make.height.equalTo(30);
    }];
    
    [self.lineView makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.contentView.left).offset(20);
        make.right.equalTo(self.contentView.right).offset(-20);
        make.bottom.equalTo(self.contentView.bottom);
        make.height.equalTo(0.5);
    }];
    
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
